<template>
  <div class="main-page-container">
    <div class="pay-container">
      <!-- 头部标题 -->
      <div class="header">
        <h2>支付二维码</h2>
      </div>

      <!-- 二维码展示区域 -->
      <div class="qr-code-container">
        <img :src="require('@/assets/img/pay.jpg')" alt="支付宝二维码" class="qr-code" />
      </div>

      <!-- 关闭按钮 -->
      <div class="button-container">
        <el-button type="primary" @click="closeDialog">关闭</el-button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Pay",
  data() {
    return {
      alipayQrCode: 'https://placehold.it/200x200?text=支付宝二维码' // 假支付宝二维码图片链接
    };
  },
  methods: {
    closeDialog() {
      // 关闭模态框或导航回上一页
      this.$router.go(-1); // 或者使用 this.$emit('close') 如果是在模态框中使用
    }
  }
};
</script>

<style scoped>
/* 主页面容器样式 */
.main-page-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #f0f0f0;
}

/* 支付容器样式 */
.pay-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 350px;
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  max-width: 600px;
  margin: 0 auto;
}

/* 头部标题样式 */
.header {
  margin-bottom: 20px;
}

/* 二维码展示区域样式 */
.qr-code-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

.qr-code {
  width: 200px;
  height: 200px;
  border: 2px solid #ccc;
  border-radius: 10px;
}

/* 按钮容器样式 */
.button-container {
  text-align: center;
  margin-top: 20px;
}

/* 按钮样式 */
.el-button {
  margin: 0 5px;
  transition: all 0.3s;
}

.el-button:hover {
  transform: scale(1.05);
}
</style>